#include "menu.h"

void TimeMenu(unsigned char *datebuf,unsigned char *timebuf)
{
	datebuf[0] = '2';
	datebuf[1] = '0';
	datebuf[2] = year / 16 + '0';
	datebuf[3] = year % 16 + '0';
	datebuf[4]='-';
	datebuf[5] = month / 16 + '0';
	datebuf[6] = month % 16 + '0';
	datebuf[7] = '-';
	datebuf[8] = day / 16 + '0';
	datebuf[9] = day % 16 + '0';
	datebuf[10] = ' ';
	datebuf[11] = 'D';
	datebuf[12] = 'a';
	datebuf[13] = 'y';
	datebuf[14] = week % 16 + '0';
	datebuf[15]='\0';

	timebuf[0] = hour / 16 + '0';
	timebuf[1] = hour % 16 + '0';
	timebuf[2] = ':';
	timebuf[3] = min / 16 + '0';
	timebuf[4] = min % 16 + '0';
	timebuf[5] = ':';
	timebuf[6] = sec / 16 + '0';
	timebuf[7] = sec % 16 + '0';
	timebuf[8] = '\0';
}

void TempertureMenu(unsigned char *tempbuf)
{
	int temp;

	temp = temperture * 10;
	tempbuf[0] = temp % 1000 / 100 + '0';
	tempbuf[1] = temp % 1000 % 100 / 10 + '0';
	tempbuf[2] = '.';
	tempbuf[3] = temp % 1000 % 100 % 10 + '0';
	tempbuf[4] = '\0';		
}

void AlarmMenu(unsigned char *alarmbuf)
{
	alarmbuf[0] = AlarmTime[1] / 16 + '0';
	alarmbuf[1] = AlarmTime[1] % 16 + '0';
	alarmbuf[2] = '-';
	alarmbuf[3] = AlarmTime[0] / 16 + '0';
	alarmbuf[4] = AlarmTime[0] % 16 + '0';
	alarmbuf[5] = '\0';		
}